Skip to content

Editor: no boxes around typographic characters; invisible ones stay marked - #42

Merged
cedricvogel-leo merged 2 commits into
mainfrom
fix/unicode-highlight
Oct 30, 2026
Merged

cedricvogel-leo merged 2 commits into
mainfrom
fix/unicode-highlight

Conversation

@cedricvogel-leo

@cedricvogel-leo cedricvogel-leo commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

P25 decision 1 (lean variant), part 1: the Monaco setting. Reworked as decided: an allow-list instead of hiding marks in strings and comments. Tag v0.1.20 after the merge.

Change

The editor's unicodeHighlight (EDITOR_UNICODE_HIGHLIGHT):

  • Allowed everywhere, no box: the typographic characters of a German text that Monaco calls "ambiguous": – ‒ ‐ ‑ (dashes), ‘ ’ ‚ ‛, ‹ ›, ×, ′. Guillemets «», “ ”, … and the umlauts were never boxed.
  • Still marked everywhere, also in strings and comments: invisible characters (non-breaking space, narrow non-breaking space, zero-width space, …). In a doctest's expected output a non-breaking space fails with an Expected/Got that look the same.
  • Other look-alikes not on the list (e.g. Cyrillic а for Latin a) stay boxed.
Before Now
"""Funktionen – vom Aufruf …""", # Kommentar – … boxed not boxed
x = 5 – 3 (code) boxed not boxed: Python reports SyntaxError: invalid character '–' (U+2013)
non-breaking space in a doctest's expected output, a comment, code, a string boxed boxed

Checked

  • Locally in the IDE with this build, a file containing:

    • «–», «», ’ and × in a docstring, a comment and code
    • a non-breaking space in a doctest's expected output, a comment and code
    • a zero-width space in a string

    Exactly the four invisible characters are boxed.

  • Lint (known warning only), both builds.

  • Noted in CLAUDE.md.

🤖 Generated with Claude Code

cedricvogel-leo and others added 2 commits October 29, 2026 23:55
Monaco boxes characters that look like others (e.g. «–» like "-") and
invisible ones. In strings and comments (docstrings with a course's German
text) it no longer does; in code, where "5 – 3" is a SyntaxError, it still
does, for both kinds. Monaco's switch for strings and comments covers both
kinds, so an invisible character inside a string or comment isn't marked
either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As decided on #42: no boxes around the typographic characters of a German
text (– ‒ ‐ ‑ ‘ ’ ‚ ‛ ‹ › × ′, the ones Monaco calls ambiguous;
guillemets, “ ” and … never were), anywhere. Invisible characters stay
marked everywhere, also in strings and comments: in a doctest's expected
output a non-breaking space fails with an Expected/Got that look the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo cedricvogel-leo changed the title Editor: no Unicode boxes in strings and comments Editor: no boxes around typographic characters; invisible ones stay marked Oct 29, 2026
@cedricvogel-leo
cedricvogel-leo merged commit 925a8ca into main Oct 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant